home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 8
/
008.d81
/
lazy math
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
4KB
|
132 lines
10 rem**lazy math
20 rem**john l.eubanks
40 rem**pineville,louisiana 71360
50 rem**11/10/84
55 rem**load "lazy",8
60 rem**calculates area,perimeter and circumference
65 rem***
68 print"[147]":poke53280,11:poke53281,11
70 print" lazy math"
72 print" by "
74 print" john l eubanks[159]"
75 fory=1to1500:nexty:print"[147]"
77 rem***instructions
80 print"use this time saver when you"
82 print"need to calculate the area of a"
84 print"square, a rectangle or a circle"
88 print"you can also calculate "
90 print"the perimeter of a square and a"
92 print"rectangle as well as the"
94 print"circumference of a circle"
96 print"lazy math will even remember "
98 print"the formulas for you and do the work!"
140 print"press the '*' key for the menu"
145 get z$:ifz$<>"*"then145
150 print"[147]"
153 print"[158]**************menu**************"
155 rem**menu with branched choices
158 print"[159]"
160 print "key # 1 for area of square"
170 print "key # 2 for area of rectangle"
180 print "key # 3 for area of circle"
185 print"[158]########################################"
190 print "key # 4 for perimeter of square"
200 print "key # 5 for perimeter of rectangle"
210 print "key # 6 for circumference of a circle"
215 print "key # 7 to exit to loadstar"
220 print"press the key # of your choice"
230 print"[159]"
235 getp$:ifp$=""then235
237 p=val(p$):ifp<1orp>7then235
240 on p goto 300,400,500,600,700,800,10000
290 rem**calculate area of square
300 print"[147]":print"area = side squared":print
310 input"enter the length of a side";s
315 print"what unit of measurement--inches,etc?"
318 input m$
320 sa=s*s:sa=(int(100*(sa+.005)))/100
325 print"[147]"
330 print"the area of your square with sides "
340 print"of ";s;m$;" is"
345 printsa;"square ";m$:print"[159]"
350 goto 1000
390 rem**calculate area of rectangle
400 print"[147]":print"area=base * height"
405 print
410 input"enter the height (short side)";h
420 input"enter the base (long side)";b
425 print"what unit of measurement--feet,etc?"
427 input m$
430 ra=b*h:ra=(int(100*(ra+.005)))/100
440 print"[147]"
450 print"the area of your rectangle with a"
460 print"height of ";h;m$
462 print"and a base of ";b;m$
464 print"is ";ra;"square ";m$:print"[159]"
470 goto1000
490 rem**calculate area of circle
500 print"[147]":print"area = pi * radius squared":print
505 print"remember that radius is 1/2 the diameter of the circle"
507 print"and diameter is the distance across"
510 input"enter the radius of your circle";r
515 print"what unit of measurement--yards,etc?"
517 input m$
520 ca=(r^2)*3.1416:ca=(int(100*(ca+.005)))/100
530 print"[147]"
540 print"the area of your circle with a"
550 print"radius of ";r;m$
552 print"is ";ca;m$:print"[159]"
560 goto1000
590 rem**calculate perimeter of square
600 print"[147]":print"perimeter =length of side * 4":print
610 input"enter the length of any side";ss
615 print"what unit of measurement--inches,etc?"
617 input m$
620 sp=ss*4:sp=(int(100*(sp+.005)))/100
625 print"[147]"
630 print"the perimeter of your square "
640 print"with sides of";ss;m$
645 print"[158]is ";sp;m$:print"[159]"
650 goto1000
690 rem**calculate the perimeter of a rectangle
700 print"[147]":print"perimeter of a rectangle is p=base*2 + height*2"
710 input"enter the base (long side)";bb
720 input"enter the height (short side)";hh
725 print"what unit of measurement--feet,etc.?"
727 input m$
730 rp=(hh*2)+(bb*2):rp=(int(100*(rp+.005)))/100
735 print"[147]"
740 print"the perimeter of your rectangle with a"
750 print"height of";hh;m$
752 print"and a base of ";bb;m$
755 print"[158]is ";rp;m$:print"[159]"
760 goto1000
790 rem**calculate circumference of a circle
800 print"[147]":print"c=pi*diameter":print
810 print"diameter is the distance across"
820 print
830 input"enter the diameter of your circle";d
835 print"what unit of measurement--inches,etc?"
837 input m$
840 cc=d*3.1416:cc=(int(100*(cc+.005)))/100
850 print"[147]"
860 print"the circumference of your circle with"
870 print"a diameter of";d;m$
875 print"[158]is ";cc;m$:print"[159]"
880 goto 1000
1000 print"when you are ready to return"
1010 print"to the menu, press the '*' key"
1020 gett$:ift$<>"*"then1020
1030 goto150
10000 print"[147]":print"are you sure that you want to quit?"
10010 print"if you answer 'y'"
10020 print"you will exit to loadstar "
10030 print"[158]answer 'y' or 'n'"
10040 input q$
10050 if q$="n"then 150
10060 if q$="y" then 63000
10070 goto10000
63000 rem connect back to l.s.
63002 print"[147]load"chr$(34)"payload"chr$(34)",8":print"run"
63004 poke198,0:poke631,13:poke632,13:poke198,2:end